//
//  BaseAccess.h
//  ZingBrowser
//
//  Created by -Xh- on 1/21/13.
//  Copyright (c) 2013 -Xh-. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FMDatabase.h"
#import "FMResultSet.h"
#import "BaseModel.h"
@interface BaseAccess : NSObject{
    FMDatabase* database;
}


-(id)initWithDatabasePath:(NSString*)_dbPath;
-(NSMutableArray*)getRecordsFromSelectQuery:(NSString*)_query;
-(NSMutableArray*)getAllRecords;
-(BaseModel*)findByID:(NSString*)_id;
-(BOOL)insert:(BaseModel*)_object;
-(BOOL)updateObjectAtURL:(NSString*)_url withNewObject:(BaseModel*)_newObject;

-(BOOL)deleteObjectAtURL:(NSString*)_url;
-(BOOL)deleteAll;

-(int)getTotalNumberOfRecords;


@end
